/**
 * 
 */
package com.maxin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import com.maxin.entity.Cart_Goods;
import com.maxin.entity.Goodstable;

/**
 * @author: maxin
 * @description: 
 */
public interface Cart_GoodsMapper {
	
	@Insert("insert into cart_goods values(#{id}, #{goodstable_id}, #{carttable_id}, #{shoppingnum})")
	int insert(Cart_Goods cart_goods);
	
	@Delete("delete from cart_goods where goodstable_id = #{goodstable_id} and carttable_id = #{carttable_id}")
	int deleteItem(Cart_Goods cart_goods);
	
	@Delete("delete from cart_goods where carttable_id = #{carttable_id}")
	int clear(long carttable_id);
	
	@Update("update from cart_goods set shoppingnum = #{shoppingnum}")
	int updateNum(int shoppingnum);
	
	List<Goodstable> selectCartByUserId(long busertable_id);
}
